Skip to content

Add a create store option to the app dev store picker - #8397

Merged
dmerand merged 5 commits into
mainfrom
donald/app-dev-store-selection-create-option
Aug 28, 2026
Merged

Add a create store option to the app dev store picker#8397
dmerand merged 5 commits into
mainfrom
donald/app-dev-store-selection-create-option

Conversation

@dmerand

@dmerand dmerand commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Important

Stacked PR. Base is dlm-app-dev-inline-store-creation (#8323), not main. This PR only shows the store-picker option on top of the inline creation flow that #8323 adds. Do not merge before #8323.

WHY are these changes introduced?

Closes shop/issues-develop#23597

#8323 lets app dev create a dev store inline, but only when the organization has zero stores. Developers with existing stores still have to leave the CLI to create a new one. Per the command-scope decision, the store picker in app dev should also offer a "create store" option.

WHAT is this pull request doing?

Adds a Create a new dev store choice to the app dev store picker for App Management organizations that already have stores. Selecting it runs the same name/plan/create/poll flow that #8323 added for the zero-store case.

  • New StoreCreationMode value 'selection-option'; only app dev opts in. All other callers keep the default 'disabled', and 'when-empty' behavior is unchanged.
  • With one or more returned stores, the picker shows those stores plus the create choice. Search finds other stores. One store no longer auto-selects when the create choice is available. The choice persists through search, and an initial store remains selectable after the search input is cleared.
  • Zero stores still create directly (no picker), as in Create dev stores from app dev #8323.
  • Cap handling: with existing stores, a capped organization keeps normal store selection and cancellation; the create choice is hidden. A partial one-store page opens a searchable picker. The flow checks the cap again before it asks for the store name or plan. With zero usable stores, a capped organization must first make a slot available in Dev Dashboard, then use the finite creation sequence from Create dev stores from app dev #8323. The cap query still fails open and never runs for Partners or disabled callers.
  • Non-interactive runs never prompt or create. With zero stores, the CLI directs the developer to run shopify store create dev with the required flags, then shopify app dev --store <store-domain>. Multiple returned stores or a partial page uses explicit shopify app dev --store <store-domain> guidance. One confirmed store still auto-selects, and explicit or cached selection still bypasses the picker.
  • Partners keeps the dashboard link/reload flow.
  • This PR does not define JSON output, NDJSON, an event stream, or a prompt protocol for app dev. The CLI JSON outputs design defers long-lived commands such as app dev and their prompt protocol.

How to test your changes?

  1. Link an app in an App Management organization that has at least one dev store.
  2. Run shopify app dev --reset. The store picker lists your stores plus Create a new dev store.
  3. Pick an existing store: dev starts as before.
  4. Run shopify app dev --reset again and pick Create a new dev store: enter a name, pick a plan, and dev continues on the new store after the success banner.

Manual tophat: this picker-entry behavior was tophatted before the stack split, on the pre-split equivalent SHA 4e85e16c (multi-store list with create choice, name/basic plan, single success banner, preview ready, explicit --store and cached-store bypass, store list stays dev-type, standalone store create dev --json unaffected, cleanup). The current child SHA has not been live-tophatted yet.

tophat screenshot

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing — I've identified the correct bump type (patch for bug fixes · minor for new features · major for breaking changes) and added a changeset with pnpm changeset add

@github-actions github-actions Bot added the Area: @shopify/app @shopify/app package issues label Aug 25, 2026
@dmerand dmerand mentioned this pull request Aug 25, 2026
4 tasks
@dmerand
dmerand marked this pull request as ready for review August 25, 2026 17:28
@dmerand
dmerand requested a review from a team as a code owner August 25, 2026 17:28
@gonzaloriestra

Copy link
Copy Markdown
Contributor

/snapit

@github-actions

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm.

Test the snapshot by installing your package globally:

pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260826122122

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

Comment thread packages/app/src/cli/prompts/dev.ts Outdated
Comment thread packages/app/src/cli/services/dev/select-store.ts Outdated
Copilot AI lite review requested due to automatic review settings August 27, 2026 18:52
@dmerand
dmerand force-pushed the donald/app-dev-store-selection-create-option branch from fecda3d to 8626ddc Compare August 27, 2026 18:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an inline “Create a new dev store” option to the app dev store picker (for App Management orgs that already have stores), reusing the same create/poll flow introduced in the stacked base PR (#8323).

Changes:

  • Introduces StoreCreationMode = 'selection-option' and wires app dev to opt into it.
  • Extends the dev store picker prompt to include a “Create a new dev store” choice (including during search) and avoids auto-selecting when that choice is available.
  • Adds/updates unit tests to cover the new selection-option behavior, including cap handling and non-interactive constraints.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/app/src/cli/services/store-context.test.ts Ensures explicit/cached store selection bypasses selection-option store listing/prompting.
packages/app/src/cli/services/dev/select-store.ts Adds selection-option mode, non-interactive gating, cap-aware “create from picker” support, and shared inline creation helper.
packages/app/src/cli/services/dev/select-store.test.ts Expands coverage for selection-option behavior (cap, Partners, non-interactive, create-from-non-empty).
packages/app/src/cli/prompts/dev.ts Adds optional “Create a new dev store” choice to the autocomplete picker and preserves it through search/pagination.
packages/app/src/cli/prompts/dev.test.ts Adds tests for pagination prompting and create-choice behavior (single store, multi store, search).
packages/app/src/cli/commands/app/dev.ts Switches app dev to use storeCreationMode: 'selection-option'.
packages/app/src/cli/commands/app/dev.test.ts Updates expectation to match the new storeCreationMode value.
.changeset/app-dev-store-picker-create-option.md Declares a minor bump and release note for the new picker option.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@nickwesselman

Copy link
Copy Markdown
Contributor

/snapit

@github-actions

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @nickwesselman! Your snapshot has been published to npm.

Test the snapshot by installing your package globally:

pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260827205340

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@dmerand
dmerand force-pushed the donald/app-dev-store-selection-create-option branch from 8626ddc to 399609b Compare August 27, 2026 21:18
@dmerand
dmerand requested a lite review from Copilot August 27, 2026 21:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

@dmerand
dmerand force-pushed the donald/app-dev-store-selection-create-option branch from 399609b to 16f0540 Compare August 27, 2026 21:40
@dmerand
dmerand requested a lite review from Copilot August 27, 2026 21:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

Assisted-By: devx/389e4e7c-5ebc-4d59-bf3e-d0eb8c0187d3
Assisted-By: devx/4593ba0e-0e3a-4487-a065-4ae504486df8
Assisted-By: devx/4593ba0e-0e3a-4487-a065-4ae504486df8
Assisted-By: devx/4593ba0e-0e3a-4487-a065-4ae504486df8
@dmerand
dmerand force-pushed the donald/app-dev-store-selection-create-option branch from 16f0540 to ff06e60 Compare August 28, 2026 13:52
@dmerand
dmerand requested a lite review from Copilot August 28, 2026 13:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Suppressed comments (3)

packages/app/src/cli/services/dev/select-store.test.ts:134

  • This assertion should also verify onCreateStoreWhenEmpty is not present. Otherwise, the test would not catch accidental introduction of the zero-store creation handler for Partners/non-interactive flows.
    expect(vi.mocked(selectStorePrompt).mock.calls[0]?.[0]).not.toHaveProperty('onCreateStore')

packages/app/src/cli/services/dev/select-store.test.ts:228

  • This test checks that onCreateStore isn't provided, but it should also assert that onCreateStoreWhenEmpty isn't provided when the org already has stores. That keeps the test aligned with the intended behavior of when-empty mode.
    expect(vi.mocked(selectStorePrompt).mock.calls[0]?.[0]).not.toHaveProperty('onCreateStore')

packages/app/src/cli/services/dev/select-store.test.ts:239

  • For the disabled creation mode, this test should also assert that onCreateStoreWhenEmpty is not set, not just onCreateStore, to ensure no creation handler is accidentally exposed through the prompt options.
    expect(vi.mocked(selectStorePrompt).mock.calls[0]?.[0]).not.toHaveProperty('onCreateStore')

Comment thread packages/app/src/cli/services/dev/select-store.test.ts
Assisted-By: devx/4593ba0e-0e3a-4487-a065-4ae504486df8

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

@dmerand
dmerand added this pull request to the merge queue Aug 28, 2026
Base automatically changed from dlm-app-dev-inline-store-creation to main August 28, 2026 14:31
Merged via the queue into main with commit eb33dc5 Aug 28, 2026
31 checks passed
@dmerand
dmerand deleted the donald/app-dev-store-selection-create-option branch August 28, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: @shopify/app @shopify/app package issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants